package com.xwh.week1;

public class Practice9 {
    public static void main(String[] args) {
        System.out.println(method(1000));
    }

    public static int method(int sum) {
        for(int i = 1; i < sum - 2; ++i) {
            for(int j = 1; j < sum - 1; ++j) {
                if (j * j + i * i == (sum - i - j) * (sum - i - j)) {
                    return i * j * (sum - i - j);
                }
            }
        }

        return -1;
    }
}
